<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>13_trim</title>
</head>

<body>
  <script>
    /**
     * trim()
     * 语法: 字符串.trim()
     * 作用: 去除字符串首尾的空白内容
     * 返回值: 去除空白内容以后的字符串
    */

    var str = '       hello world        ';
    console.log('原始字符串:', str,  str.length);

    var result = str.trim()
    console.log('去除首尾空白:', result, result.length);
  </script>
</body>

</html>
